<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    class Person {
        name = "xiaoxin";
        age = 18;

        constructor() {
            this.gender = "男";
            this.address = "长沙"
        }

        say() {
            console.log(this.name);
        }
    }

    class Student extends Person{
        school = "csuft"
    }

    let p = new Person();
    // console.log(p)          // name,age,gender,address都在实例身上，只有方法在原型上
    let stu = new Student();
    console.log(stu);           // name,age,gender,address,school都在实例身上，只有方法在原型上


</script>

</html>